/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.goods.dao.ZtSpecificationsDao;
import com.jeesite.modules.goods.entity.ZtSpecifications;

/**
 * 测试数据Service
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Service
@Transactional(readOnly = true)
public class ZtSpecificationsService extends CrudService<ZtSpecificationsDao, ZtSpecifications> {
	
	/**
	 * 获取单条数据
	 * 
	 * @param testData
	 * @return
	 */
	@Override
	public ZtSpecifications get(ZtSpecifications ztSpecifications) {
		ZtSpecifications entity = super.get(ztSpecifications);
		if (entity == null) {
			entity = new ZtSpecifications();
		}
		return entity;
	}
	
	public ZtSpecifications getBySku(ZtSpecifications ztSpecifications) {
		return dao.getBySku(ztSpecifications);
	}
	
	

	/**
	 * 查询分页数据
	 * 
	 * @param page
	 *            分页对象
	 * @param testData
	 * @return
	 */
	@Override
	public Page<ZtSpecifications> findPage(Page<ZtSpecifications> page, ZtSpecifications ztSpecifications) {
		return super.findPage(page, ztSpecifications);
	}

	/**
	 * 保存数据（插入或更新）
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void save(ZtSpecifications ztSpecifications) {
		super.save(ztSpecifications);
		
	}


	/**
	 * 删除数据
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void delete(ZtSpecifications ztSpecifications) {
		super.delete(ztSpecifications);
	}
	
	

}